package org.shj.util;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class StoreUtils {

	private static Map<String, String> tokenSessionMap = new ConcurrentHashMap<>();
	private static Map<String, String> sessionTokenMap = new ConcurrentHashMap<>();
	private static Map<String, String> tokenUserMap = new ConcurrentHashMap<>();
	
	public static void addUserSession(String token, String sessionId, String userId){
		tokenSessionMap.put(token, sessionId);
		sessionTokenMap.put(sessionId, token);
		tokenUserMap.put(token, userId);
	}
	
	public static String getToken(String sessionId){
		return sessionTokenMap.get(sessionId);
	}
	
	public static String getSessionByToken(String token){
		return tokenSessionMap.get(token);
	}
}
